import { IModel, SPI, FormWidget, BaseElementWidget, getModelByUrl, getModel, Widget, queryPage, queryOne, CustomWidget, http, IModelField} from '@kunlun/dependencies'
import CreateCource  from './CreateCource.vue'
@SPI.ClassFactory(CustomWidget.Token({ widget: 'create-cource' }))
export class CreateCourceWidget extends FormWidget {
    public initialize(props) {
        super.initialize(props);
        this.setComponent(CreateCource);
        return this;
    }


    protected async mounted() {
        super.mounted();
    
        this.loadData();
    }

    @Widget.Method()
    public async loadData() {
        console.log("model: ",this.model)
        const data = await queryOne(this.model.model, { pageSize: 15, currentPage: 1}, undefined , { scene: "CourseMenus_ItemPMenu_CourseEntityMenu" }, { context: 123 })
    
        console.log("result: ", data)
        
    }
}